#pragma once

#include "Factory.h"

namespace TestFactory
{

void RunAllTests ();

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

class DummyInterface;
typedef Factory < DummyInterface >::Ptr DummyInterfacePtr;

class Dummy;
typedef Factory < DummyInterface >::CastedPtr < Dummy > DummyPtr;

class DummyInterface
{
public:
	virtual ~DummyInterface () {}
	virtual void DoSomething () = 0;
};

class Dummy
: public DummyInterface
{
	friend class Factory < DummyInterface >;
public:
	static DummyPtr Spawn ();
	static int Count ();
	static void CheckInnocence ();
private:
	Dummy ();
	~Dummy ();
	void DoSomething ();
public:
	static int dummiesCreated;
	static int dummiesDeleted;
	int somethingDid;
private:
	static Factory < DummyInterface > factory;
};

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

class TestBase
{
public:
	std::string SuiteIdentity ();
};

class TestLifeTime
: public TestBase
{
public:
	static void Run ();
	std::string TestIdentity ();
private:
	TestLifeTime ();
};

class TestNull
: public TestBase
{
public:
	static void Run ();
	std::string TestIdentity ();
private:
	TestNull ();
};

class TestCopy
: public TestBase
{
public:
	static void Run ();
	std::string TestIdentity ();
private:
	TestCopy ();
};

class TestAccess
: public TestBase
{
public:
	static void Run ();
	std::string TestIdentity ();
private:
	TestAccess ();
};

class TestCounter
: public TestBase
{
public:
	static void Run ();
	std::string TestIdentity ();
private:
	TestCounter ();
};

}; // namespace TestFactory
